import os


class Config:
    # 基础配置
    BASE_DIR = os.path.abspath(os.path.dirname(__file__))

    # 上传文件配置
    UPLOAD_FOLDER = os.path.join(BASE_DIR, 'uploads')
    if not os.path.exists(UPLOAD_FOLDER):
        os.makedirs(UPLOAD_FOLDER)

    # 静态文件配置
    STATIC_FOLDER = os.path.join(BASE_DIR, 'static')
    OUTPUT_FILEPATH = os.path.join(STATIC_FOLDER, 'data')

    # 日志配置
    LOG_FILE = os.path.join(BASE_DIR, 'app.log')
    LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
    LOG_LEVEL = 'INFO'

    # 成绩等级默认配置
    DEFAULT_GRADE_LEVELS = [
        {'name': 'A++', 'min': 95, 'max': 100},
        {'name': 'A+', 'min': 90, 'max': 94.99},
        {'name': 'A', 'min': 85, 'max': 89.99},
        {'name': 'B', 'min': 75, 'max': 84.99},
        {'name': 'C', 'min': 60, 'max': 74.99},
        {'name': 'D', 'min': 0, 'max': 59.99}
    ]
